package com.zeny.online.controller;


import com.zeny.online.common.OperatorFriendRequestTypeEnum;
import com.zeny.online.common.ResponseResult;
import com.zeny.online.entity.vo.MyFriendVO;
import com.zeny.online.service.MyFriendsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 */
@RestController
@RequestMapping("/online/my-friends")
@Api(tags = "好友模块")
public class MyFriendsController {

    @Autowired
    private MyFriendsService myFriendsService;

    @PostMapping("/myFriendList")
    @ApiOperation(value = "获取好友列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户ID", required = true)
    })
    public ResponseResult getMyFriendList(String userId) {
        if (StringUtils.isBlank(userId)) {
            return ResponseResult.fail();
        }
        List<MyFriendVO> friendVOList = myFriendsService.getMyFriendList(userId);
        return ResponseResult.ok().data(friendVOList);
    }
}

